<?php
$config = parse_ini_file(__DIR__ . "/../env", true);
$keys = array_keys($config);
$db_config = [];
$prefix = "database.";
$len = strlen($prefix);
foreach ($keys as $key) {
    if (substr($key, 0, $len) == $prefix) {
        if (isset($config[$key])) {
            $newKey = substr($key, $len);
            $db_config[$newKey] = $config[$key];
        }
    }
}

